package cn.sciento.core.algorithm.tree;

import java.util.List;

public class Child<T> {
    private List<T> children;

    public List<T> getChildren() {
        return this.children;
    }

    public Child<T> addChildren(List<T> children) {
        if (this.children == null) {
            this.children = children;
        } else {
            this.children.addAll(children);
        }
        return this;
    }

    public Integer getChildrenCount() {
        if (this.children == null) {
            return null;
        }
        return Integer.valueOf(this.children.size());
    }

    public String toString() {
        return "Child{children=" + this.children + '}';
    }
}
